home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / c-tools / c_examples / appwindow / appwindow_example.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-19  |  1.4 KB  |  61 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // AppWindow Example
  3. // 5.18.96 Deryk Robosson
  4.  
  5. //////////////////////////////////////////////////////////////////////////////
  6. // Includes
  7. #include "aframe:include/amigaapp.hpp"
  8. #include "aframe:include/appwindow.hpp"
  9. #include "aframe:include/rect.hpp"
  10. #include "aframe:include/reqtools.hpp"
  11. #include <workbench/startup.h>
  12. #include <workbench/workbench.h>
  13.  
  14. //////////////////////////////////////////////////////////////////////////////
  15. // ControlWindow Class Definition
  16.  
  17. class ControlWindow : public AFAppWindow
  18. {
  19. public:
  20.     ControlWindow();
  21.     virtual void OnAppWindow(LPAppMessage amess);
  22.  
  23.     AFReqTools rt;
  24. };
  25.  
  26. //////////////////////////////////////////////////////////////////////////////
  27. // ControlWindow Implementation routines
  28.  
  29. ControlWindow::ControlWindow()
  30. {
  31.     rt.EZRequest("Drop a file(s) on me","Ok");
  32. }
  33.  
  34. void ControlWindow::OnAppWindow(LPAppMessage amess)
  35. {
  36.     struct WBArg    *argptr;
  37.     int i;
  38.  
  39.     argptr = amess->am_ArgList;
  40.  
  41.     for(i=0;i<amess->am_NumArgs;i++) {
  42.         printf("Items: %s\n",argptr->wa_Name);
  43.         argptr++;
  44.     }
  45. }
  46.  
  47. //////////////////////////////////////////////////////////////////////////////
  48. // MAIN
  49.  
  50. void main()
  51. {
  52.     AFAmigaApp theApp;
  53.     ControlWindow win;
  54.     AFRect rect(10,10,100,100);
  55.  
  56.     win.Create(&theApp,&rect,1l);
  57.     win.SetWindowTitles((UBYTE*)"AFrame Window Example",(UBYTE*)NULL);
  58.  
  59.     theApp.RunApp();
  60. }
  61.